package org.xiaojinlong.reading;

import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;

import java.util.*;

/**
 * Created by jinlong on 2015/1/31.
 */
public class Container {
    public static void main(String[] args) {
//        List<Apple> apples = new ArrayList<>();
//        for (int i = 0; i < 3; i++)
//            apples.add(new Apple());
//        apples.add(new GrannySmith());
//        apples.add(new Gala());
//        apples.add(new Fuji());
//
//        for (Apple apple : apples) {
//            System.out1.println(apple.id());
//        }
//
//        Collection<Integer> collection =
//                new ArrayList<>(Arrays.asList(1, 2, 3, 4, 5, 6));
//        Integer[] moreInts = { 7, 8, 9, 10, };
//        collection.addAll(Arrays.asList(moreInts));
//        Collections.addAll(collection, 11, 12, 13, 14, 15);
//        Collections.addAll(collection, moreInts);
//
//        List<Snow> snow1 = Arrays.asList(
//                new Crusty(), new Slush(), new Powder()
//        );
//        List<Snow> snow2 = Arrays.asList(
//                new Light(), new Heavy()
//        );
//        List<Snow> snow3 = new ArrayList<>();
//        Collections.addAll(snow3, new Light(), new Heavy());
//
//        List<Snow> snow4 = Arrays.<Snow>asList(
//                new Light(), new Heavy()
//        );
//
//        for (Snow snow : snow2) {
//            System.out1.println(snow);
//        }
//        String j = StringUtils.join(new String[] { "a", "b", "c" }, ", ");
//        System.out1.println(j);
//        int[] a = { 1, 2, 3, 4, 5 };
//        ArrayUtils.reverse(a);
//        System.out1.println(Arrays.toString(a));
//        List<String> aList = new ArrayList<>();
//        Collections.addAll(aList, "a", "b", "c");
//        List<String> bList = new ArrayList<>();
//        Collections.addAll(bList, "c", "d", "e");
////        Collections.shuffle(aList, new Random(43));
//        aList.retainAll(bList);
//        System.out1.println(aList);
//        System.out1.println(bList);
//        String[] ss = new String[] { "ab", "cd" };
//        int[] ints = { 1, 2, 3, 4, 5, };
//        int[] another = { 5, 6, 7, 8 };
//        System.out1.println(Arrays.toString(ArrayUtils.addAll(ints, another)));

    }
}

class Snow {}
class Powder extends Snow {}
class Light extends Powder {}
class Heavy extends Powder {}
class Crusty extends Snow {}
class Slush extends Snow {}

class GrannySmith extends Apple {}
class Gala extends Apple {}
class Fuji extends Apple {}

class Apple {
    private static long counter;
    private final long id = counter++;
    public long id() { return id; }
}

class Orange {}